import request from '@/utils/request'

export default {

  list() {
    return request({
      url: `/main/room-time-slice/list`,
      method: 'get'
    })
  },

  reverse(reverseInfo){
    return request({
      url: `/main/room-reservation/reserve`,
      method: 'post',
      data: reverseInfo
    })
  },
  cancelBySliceId(sliceId){
    return request({
      url: `/main/room-reservation/cancelBySliceId/${sliceId}`,
      method: 'get',
    })
  },
  cancel(id){
    return request({
      url: `/main/room-reservation/cancel/${id}`,
      method: 'get',
    })
  },

  getByQuery(querySliceVo){
    return request({
      url: `/main/room-time-slice/getByQuery`,
      method: 'post',
      data: querySliceVo
    })
  },

  getByUserId() {
    return request({
      url: `/main/room-reservation/getByUserId`,
      method: 'get'
    })
  },

  login(user){
    return request({
      url: `/main/user/login`,
      method: 'post',
      data: user
    })
  },
  getUserInfo() {
    return request({
      url: `/main/user/getUserInfo`,
      method: 'get',
    })
  },
  updateUserInfo(user){
    return request({
      url: `/main/user/update`,
      method: 'put',
      data: user
    })
  },
  getCode(mail){
    return request({
      url: `/main/user/getCode/${mail}`,
      method: 'get',
    })
  },
  sendMail(mail){
    return request({
      url: `/main/user/send_mail/${mail}`,
      method: 'post',
    })
  },
  retPassword(retPwd){
    return request({
      url: `/main/user/retPassword/`,
      method: 'post',
      data: retPwd
    })
  },
  uploadCredentials(credentials){
    return request({
      url: `/main/credentials/add`,
      method: 'post',
      data: credentials
    })
  }

}

